package com.qclix.inv.xml;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class XMLInvoice implements Comparable<XMLInvoice>, Serializable {

    private String number;
    private Date issueDate;
    private XMLClient XMLClient;
    private List<XMLInvoiceLine> lines;

    public String getNumber() {
        return number;
    }

    public void setNumber(String value) {
        this.number = value;
    }

    public Date getIssueDate() {
        return issueDate;
    }

    public void setIssueDate(Date value) {
        this.issueDate = value;
    }

    public XMLClient getClient() {
        return XMLClient;
    }

    public void setClient(XMLClient value) {
        this.XMLClient = value;
    }

    public List<XMLInvoiceLine> getLines() {
        if (lines == null) {
            lines = new ArrayList<XMLInvoiceLine>();
        }
        return this.lines;
    }

    public int compareTo(XMLInvoice o) {
        if (o == null)
            return 1;
        int dateComparison = this.issueDate.compareTo(o.issueDate);
        if (dateComparison != 0)
            return dateComparison;
        return this.number.compareTo(o.number);
    }

}